// Copyright © SixtyFPS GmbH <info@slint.dev>
// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0

// Verify that this compiles with all generators

Test := Rectangle {
    background: @linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
    property <color> foo: #a23;
    property <brush> bar: @linear-gradient(1.2rad, foo.darker(0.5), foo.brighter(0.5), );

    for data in [{xx: #b56}] : Rectangle {
        background: @linear-gradient(1.2rad, data.xx, blue);
    }

    property <color> c: @linear-gradient(90deg,#e2e1e1,#c5c5c5);


    Rectangle {
        property <color> col1 : #f0f;
        property <color> col2 : #0ff;
        property <color> col3 : #ff0;
        property <duration> time : 2s;
        property <float> animated : 2 * Math.mod(animation-tick()/2s, 1);
        property <float> animated2 : 2* Math.mod(animation-tick()/-2s, 1);
        background:
            self.animated <= 1 ? @linear-gradient(90deg, self.col1 self.animated * 0.1, self.col3 self.animated * 1, self.col1 self.animated2 * 1)
            : self.animated <= 2 ? @linear-gradient(90deg, self.col1 self.animated2 * 0.1, self.col3 self.animated2 * 1, self.col1 self.animated * 1)
            : @linear-gradient(90deg, self.col1 self.animated2 * 10, red self.animated2 * 150, self.col1 self.animated2 * 200);

    }

}
